home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmigaPlus / Tools / Development / RxMUI / Examples / SB3.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2004-01-31  |  5.4 KB  |  171 lines

  1. /* Speedbar beauty */
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. call init
  7. call createApp
  8. call handleApp
  9.  
  10. /***********************************************************************/
  11. init: procedure expose global.
  12.     l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  13.     if AddLibrary("rexxsupport.library","rxmui.library")~=0 then exit
  14.     call ProgDir()
  15.     return
  16. /***********************************************************************/
  17. handleApp: procedure expose global.
  18.     do forever
  19.         call NewHandle("app","h",4096)
  20.         if and(h.signals,4096)>0 | h.event="QUIT" then exit
  21.         interpret h.event
  22.     end
  23. /***********************************************************************/
  24. createApp: procedure expose global.
  25.     app.Title="Speedbar"
  26.     app.Version="$VER: Speedbar3 1.0 (24.2.2002)"
  27.     app.Copyright="©2002, alfie"
  28.     app.Author="alfie"
  29.     app.Description="Speedbar example"
  30.     app.Base="SPEEDBAR"
  31.     app.SubWindow="WIN"
  32.      win.ID="MAIN"
  33.      win.Title="Speedbar Example"
  34.      win.Contents="MGROUP"
  35.  
  36.       mgroup.horiz=1
  37.  
  38.       mgroup.0="spg"
  39.         spg.class="group"
  40.         spg.frame="group"
  41.         spg.Background="FillBack"
  42.         spg.Weight=0
  43.          spg.0="sb0"
  44.           sb0.class="SpeedBar"
  45.           sb0.RaisingFrame=0
  46.           sb0.Borderless=0
  47.           sb0.ImagesDrawer="PROGDIR:Pics"
  48.           sb0.StripUnderscore=1
  49.           sb0.EnableUnderscore=1
  50.           sb0.Spread=1
  51.           sb0.Rows=3
  52.           sb0.Spacing=1
  53.           sb0.SameSize=1
  54.  
  55.            i=0
  56.  
  57.            sb0.i.Text="_Back"
  58.            sb0.i.Img="back"
  59.            sb0.i.Help="Button"
  60.            i=i+1
  61.  
  62.            sb0.i.Text="_Forward"
  63.            sb0.i.Img="forward"
  64.            sb0.i.Help="Button"
  65.            i=i+1
  66.  
  67.            sb0.i.Text="Reload"
  68.            sb0.i.Img="reload"
  69.            sb0.i.Help="Immediate"
  70.            sb0.i.Flags="Immediate"
  71.            i=i+1
  72.  
  73.            sb0.i.Text="Stop"
  74.            sb0.i.Img="stop"
  75.            sb0.i.Help="Toggle"
  76.            sb0.i.Flags="Toggle"
  77.            i=i+1
  78.  
  79.            sb0.i.Img="home"
  80.            sb0.i.Text="Home"
  81.            sb0.i.Help="MutualExclude with Find"
  82.            sb0.i.Flags="Selected"
  83.            sb0.i.Exclude=2**(i+1)
  84.            i=i+1
  85.  
  86.            sb0.i.Text="Find"
  87.            sb0.i.Img="find"
  88.            sb0.i.Help="MutualExclude with Home"
  89.            sb0.i.Exclude=2**(i-1)
  90.            i=i+1
  91.  
  92.          spg.1=vspace()
  93.  
  94.      mgroup.1="rg"
  95.       rg.class="group"
  96.  
  97.        cg.class="group"
  98.        cg.0="cgf"
  99.         cgf.class="group"
  100.         cgf.columns=4
  101.          cgf.0=label("Bord_erLess")
  102.          cgf.1=checkmark("BL",,'e')
  103.          cgf.2=label("_RaisingFrame")
  104.          cgf.3=checkmark("RF",,'r')
  105.          cgf.4=label("_ScaledImages")
  106.          cgf.5=checkmark("SI",,'s')
  107.          cgf.6=label("Sunn_y")
  108.          cgf.7=checkmark("SN",,'y')
  109.        cg.1=MakeObj(,"HGroup",label("_View Mode"),MakeObj("vm","Cycle","TextGfx|Gfx|Text","v"))
  110.        cg.2=MakeObj(,"HGroup",label("Label _Pos"),MakeObj("pos","Cycle","Bottom|Top|Right|Left","p"))
  111.       rg.0=MakeObj(,"HFRAMEGROUP","Config",MakeObj(,"VCenter",MakeObj(,"HCenter","cg")))
  112.  
  113.        hg.class="group"
  114.        hg.columns=2
  115.         hg.0=Label("Disable Back")
  116.         hg.1=MakeObj(,"HLeft",checkmark("cm1"))
  117.         hg.2=Label("Select Reload")
  118.         hg.3=MakeObj(,"HLeft",checkmark("cm2"))
  119.         hg.4=label("Rows")
  120.         hg.5=MakeObj(,"HLeft",MakeObj("sl","Radio","1    |2    |3    |6    ",,2,1))
  121.       rg.1=MakeObj(,"HFRAMEGROUP","Control",MakeObj(,"VCenter","hg"))
  122.  
  123.     if NewObj("APPLICATION","APP")>0 then exit
  124.  
  125.     call get("sb0","nobrushes","nb")
  126.     call set("vm","disabled",nb)
  127.     call set("sn","disabled",nb)
  128.     call set("si","disabled",nb)
  129.  
  130.     call Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  131.     call Notify("BL","SELECTED","EVERYTIME","sb0","SET","BORDERLESS","TRIGGERVALUE")
  132.     call Notify("RF","SELECTED","EVERYTIME","sb0","SET","RAISINGFRAME","TRIGGERVALUE")
  133.     call Notify("SI","SELECTED","EVERYTIME","sb0","SET","SMALLIMAGES","TRIGGERVALUE")
  134.     call Notify("SN","SELECTED","EVERYTIME","sb0","SET","SUNNY","TRIGGERVALUE")
  135.     call Notify("vm","Active","EveryTime","sb0","Set","ViewMode","TriggerValue")
  136.     call Notify("pos","Active","EveryTime","sb0","Set","LabelPosition","TriggerValue")
  137.  
  138.     call Notify("sb0","ACTIVE","EveryTime","app","return","say 'Active:'h.active","triggerattr")
  139.  
  140.     call Notify("cm1","selected","EveryTime","sb0","SBSET",0,"Disabled","TriggerValue")
  141.     call Notify("cm2","selected","EveryTime","sb0","SBSET",2,"Selected","TriggerValue")
  142.     call Notify("sl","Active","EveryTime","App","return","call ChangeRows")
  143.  
  144.     call SBNotify("sb0",0,"pressed",0,"app","return","say 'Pressed:' 0")
  145.     call SBNotify("sb0",1,"pressed",0,"app","return","say 'Pressed:' 1")
  146.  
  147.     call SBNotify("sb0",2,"selected","EveryTime","cm2","set","selected","TriggerValue")
  148.  
  149.     call SBNotify("sb0",0,"disabled",0,"app","return","say 'Enabled:'0")
  150.     call SBNotify("sb0",0,"disabled",1,"app","return","say 'Disabled:'0")
  151.  
  152.     call set("win","open",1)
  153.  
  154.     return
  155. /**************************************************************************/
  156. ChangeRows: procedure
  157.     call DoMethod("sb0","InitChange")
  158.     t.0=1
  159.     t.1=2
  160.     t.2=3
  161.     t.3=6
  162.     a=xget("sl","active")
  163.     call set("sb0","Rows",t.a)
  164.     call DoMethod("sb0","ExitChange")
  165.     return
  166. /***********************************************************************/
  167. halt:
  168. break_c:
  169.     exit
  170. /***********************************************************************/
  171.